<template>
  <div class="emergencyPage">
    <div class="emergencyLeft">
      <div class="emergencyTab">
        <div
          v-for="(item, index) of areaTabList"
          :key="index"
          :class="{ active: areaTabIndex == index }"
          class="areaTabItem"
          @click="onAreaTabClick(item)"
        >
          {{ item.name }}
        </div>
      </div>
      <div class="header headerGreen">监控数据总览</div>
      <div class="monitoringData cleafix">
        <div
          v-for="(item, index) of monitoringData"
          :key="index"
          class="monitoringDataItem"
        >
          <p class="monitoringName">{{ item.name }}</p>
          <p class="monitoringValue">{{ item.value }}</p>
        </div>
      </div>
      <div class="header headerRed">报警详情</div>
      <div class="warningInfo">
        <div
          v-for="(item, index) of warningTabList"
          :key="index"
          :class="{ active: warningTabIndex == index }"
          class="warningTab"
          @click="onWarningTabClick(item)"
        >
          {{ item.name }}
        </div>
      </div>
      <div class="warningTable">
        <dv-scroll-board
          :config="warningTableConfig"
          style="width: 100%; height: 100%"
          @click="warningTableClick"
        />
      </div>
    </div>
    <div class="emergencyMiddle"></div>
    <div class="emergencyRight">
      <div class="header headerRed">安保监控</div>
      <div class="monitoringImg clearfix">
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="area">东门</div>
        </div>
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="area">停车场出口</div>
        </div>
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="area">西门</div>
        </div>
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="area">停车场入口</div>
        </div>
      </div>
      <div class="header headerRed">消防监控</div>
      <div class="monitoringImg clearfix">
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="areaDiv">
            <div class="area">A座大门</div>
            <div class="area">A座一层</div>
          </div>
        </div>
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="areaDiv">
            <div class="area">A座大门</div>
            <div class="area">A座一层</div>
          </div>
        </div>
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="areaDiv">
            <div class="area">A座大门</div>
            <div class="area">A座一层</div>
          </div>
        </div>
        <div class="monitoringImgItem">
          <div class="poster"></div>
          <div class="areaDiv">
            <div class="area">A座大门</div>
            <div class="area">A座一层</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      areaTabList: [
        { name: "区域一", index: 0 },
        { name: "区域二", index: 1 },
        { name: "区域三", index: 2 },
        { name: "区域四", index: 3 },
      ],
      areaTabIndex: 0,
      warningTabList: [
        { name: "消防", index: 0 },
        { name: "电梯", index: 1 },
        { name: "安保", index: 2 },
      ],
      warningTabIndex: 0,
      monitoringData: [
        { name: "安全监控场所", value: 23 },
        { name: "安全监控设备", value: 1223 },
        { name: "监控报警", value: 34 },
        { name: "消防监控场所", value: 54 },
        { name: "消防监控设备", value: 456 },
        { name: "消防报警", value: 89 },
        { name: "电梯监控场所", value: 16 },
        { name: "电梯台数", value: 236 },
        { name: "报警设备", value: 89 },
      ],
      warningTableConfig: {
        header: ["<span style='color:#6C9BFF'>场所</span>", "<span style='color:#6C9BFF'>位置</span>", "<span style='color:#6C9BFF'>报告类型</span>", ""],
        headerBGC: 'none',
        oddRowBGC: 'none',
        evenRowBGC: '#143562',
        data: [
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
          ["南华大厦", "12梯", "电梯报警", "<span style='background:#ff4201;padding:2px 10px;border-radius:10px;cursor:pointer'>查看</span>"],
        ],
      },
    };
  },
  methods: {
    onAreaTabClick: function (item) {
      this.areaTabIndex = item.index;
    },
    onWarningTabClick: function (item) {
      this.warningTabIndex = item.index;
    },
    warningTableClick: function(row) {
      console.log(row)
    }
  },
  created() {},
  mounted() {},
};
</script>

<style lang="scss" scoped>
@import "../../style//emergency.scss";
</style>
